<html>
<body>
<p>Click the button to see the list.</p>
<button onclick="myFunction()">click here</button>
<p id="demo"></p>

<script>
function myFunction()
{
	var person=new Object();
	person={firstname:"John",lastname:"David",age:50};
	var txt=" ";
	var x;
	
	for (x in person)
	{
		txt=txt+person[x];
	}
	document.getElementById("demo").innerHTML=txt;
	
}
</script>
</body>
</html>